/*-
 * Copyright (c) 2006 - 2010 CTPP Team
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 4. Neither the name of the CTPP Team nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *      php_ctpp.h
 *
 * $CTPP$
 */
#ifndef _PHP_CTPP_H__
#define _PHP_CTPP_H__ 1

/* C Includes */
extern "C"
{
    #ifdef HAVE_CONFIG_H
        #include "config.h"
    #endif

    #include "php.h"
//    #include "safe_mode.h"
    #include "php_globals.h"
    #include "php_ini.h"
    #include "ext/standard/php_standard.h"
    #include "ext/standard/info.h"
    #include "ext/standard/html.h"
    #include "main/fopen_wrappers.h"
}

#ifdef PHP_WIN32
    #define PHP_CTPP_API __declspec(dllexport)
#else
    #define PHP_CTPP_API
#endif

#ifdef ZTS
    #include "TSRM.h"
#endif

extern zend_module_entry ctpp_module_entry;

PHP_MINIT_FUNCTION(ctpp);
PHP_MSHUTDOWN_FUNCTION(ctpp);
PHP_RINIT_FUNCTION(ctpp);
PHP_RSHUTDOWN_FUNCTION(ctpp);
PHP_MINFO_FUNCTION(ctpp);

PHP_FUNCTION(ctpp_new);
PHP_FUNCTION(ctpp_destroy);
PHP_FUNCTION(ctpp_include_dirs);
PHP_FUNCTION(ctpp_parse_template);
PHP_FUNCTION(ctpp_load_bytecode);
PHP_FUNCTION(ctpp_free_bytecode);
PHP_FUNCTION(ctpp_save_bytecode);
PHP_FUNCTION(ctpp_emit_params);
PHP_FUNCTION(ctpp_reset_params);
PHP_FUNCTION(ctpp_output);
PHP_FUNCTION(ctpp_output_string);
PHP_FUNCTION(ctpp_dump_params);
PHP_FUNCTION(ctpp_dump_params_string);
PHP_FUNCTION(ctpp_set_steps_limit);
PHP_FUNCTION(ctpp_get_last_error);

ZEND_BEGIN_MODULE_GLOBALS(ctpp)
	long      arg_stack_size;
	long      code_stack_size;
	long      steps_limit;
	long      cache_bytecode;
	long      max_functions;
	long      debug_level;
ZEND_END_MODULE_GLOBALS(ctpp)

#ifdef ZTS
    #define CTPP_G(v) TSRMG(ctpp_globals_id, zend_ctpp_globals *, v)
#else
    #define CTPP_G(v) (ctpp_globals.v)
#endif

#endif /* _PHP_CTPP_H__ */

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: noet sw=4 ts=4 fdm=marker
 * vim<600: noet sw=4 ts=4
 */
